#include<opencv2/highgui/highgui.hpp>
#include<opencv2/imgproc/imgproc.hpp>
#include<opencv2/core/core.hpp>
#include <iostream>
#include <stdio.h>

using namespace cv;
using namespace std;

int main() {
    VideoCapture capture(1);
    double rate = 30.0;
    Size videoSize(640, 480);
    VideoWriter writer("../AirRobotTestVideo.avi", CV_FOURCC('M', 'J', 'P', 'G'), rate, videoSize);
    Mat frame, testImg, blurImg;
    while (capture.isOpened()) {
        capture >> frame;
        writer << frame;
        cv::Mat imageShow = frame.clone();
        resize(imageShow, imageShow, cv::Size(0, 0), 0.3, 0.3);
        namedWindow("video",WINDOW_NORMAL);
        imshow("video", imageShow);
        if (waitKey(20) == 27) {
            break;
        }
    }
}